home *** CD-ROM | disk | FTP | other *** search
/ Trusted Irix /B 4.0.4 / Trusted-Irix B-4.0.1.iso / dist / eoe1.idb / usr / include / sys / IP4.h.z / IP4.h
C/C++ Source or Header  |  1992-04-03  |  9KB  |  268 lines

  1. /**************************************************************************
  2.  *                                      *
  3.  *          Copyright (C) 1987, Silicon Graphics, Inc.          *
  4.  *                                      *
  5.  *  These coded instructions, statements, and computer programs  contain  *
  6.  *  unpublished  proprietary  information of Silicon Graphics, Inc., and  *
  7.  *  are protected by Federal copyright law.  They  may  not be disclosed  *
  8.  *  to  third  parties  or copied or duplicated in any form, in whole or  *
  9.  *  in part, without the prior written consent of Silicon Graphics, Inc.  *
  10.  *                                      *
  11.  **************************************************************************/
  12.  
  13. #ident "$Revision: 1.31 $"
  14.  
  15. #ifndef __SYS_IP4_H__
  16. #define __SYS_IP4_H__
  17.  
  18. #if !LOCORE
  19. #include "sys/types.h"
  20. #endif /* !LOCORE */
  21. /*
  22.  * IP4.h -- cpu board specific defines for IP4
  23.  */
  24.  
  25. /*
  26.  * CPU Board addresses
  27.  */
  28. #define    VME_IACK    0x1df00002    /* VME interrupt acknowledge */
  29. #define SOUND_DAT_ADDR    0xbf600000    /* SAA1099 stereo sound generator */
  30. #define SOUND_CMD_ADDR    0xbf600010
  31. #define    SYSID_ADDR    0xbf800001    /* System ID prom/Coprocessor present */
  32. #define    VME_ISR        0x1f840003    /* interrupt status */
  33. #define    VME_IMR        0x1f84000b    /* interrupt mask */
  34. #define CPU_CONFIG    0x1f880002    /* Control and status register (h) */
  35. #define SCSI_DMALO_ADDR    0xbf900002    /* Low address register (h)*/
  36. #define SCSI_DMAHI_ADDR    0xbf920002    /* High address register array (16h)*/
  37. #define    SCSI_FLUSH_ADDR    0xbf940000    /* DMA flush bytes to memory */
  38. #define LIO_ISR_ADDR    0x1f980003    /* Local IO interrupt status (b) */
  39. #define SWTCH_ADDR    0x1f9a0002    /* switches (h) */
  40. #define    TIM1_ACK_ADDR    0xbfa00000    /* clear T1 interrupt (b) */
  41. #define    TIM0_ACK_ADDR    0xbfa20000    /* clear T0 interrupt (b) */
  42. #define    SBE_ADDR    0x1fa40000    /* system bus error address (w)*/
  43. #define    VME_RMW_ADDR    0xbfa60000    /* VME RMW toggle */
  44. #define    SCSI_RDY_ADDR    0xbfa80000    /* Deactivate master reset on chip */
  45. #define    SCSI_INIT_ADDR    0xbfa80004    /* Activate master reset on chip */
  46. #define PAR_CL_LAN_ADDR    0x1faa0000    /* Clear LAN Access bit (b) */
  47. #define PAR_CL_DMA    0x1faa0001    /* Clear DMA Access bit (b) */
  48. #define PAR_CL_CPU    0x1faa0002    /* Clear CPU Access bit (b) */
  49. #define PAR_CL_VME    0x1faa0003    /* Clear VME Access bit (b) */
  50. #define PAR_ERR_ADDR    0x1faa0005    /* Parity error register (b) */
  51. #define    ID_ADDR        0xbfae0000    /* ID prom address */
  52. #define    PT_CLOCK_ADDR    0xbfb40000    /* Timer chip */
  53. #define SCSI0_ADDR    0xbfb00001    /* SCSI WD33C93 address register */
  54. #define SCSI1_ADDR    0xbfb00101    /* SCSI WD33C93 data register */
  55. #define    DUART0_ADDR    0xbfb80000    /* Keyboard/mouse DUART */
  56. #define    DUART1_ADDR    0xbfb80004    /* Second DUART */
  57. #define    DUART2_ADDR    0xbfb80008    /* Third DUART */
  58. #define    NVRAM_ADDR    0xbfbc0000    /* Non-volatile RAM address */
  59. #define    RT_CLOCK_ADDR    (NVRAM_ADDR+(0x7ff<<2))
  60.                     /* Time of day clock address */
  61.  
  62. /*
  63.  * Configuration register bits
  64.  */
  65. #define CONFIG_LEDS    0x001f        /* LED bits */
  66. #define CONFIG_S01    0x0040        /* Enable drive for serial ports 0,1 */
  67. #define CONFIG_S23    0x0080        /* Enable drive for serial ports 2,3 */
  68. #define CONFIG_MAIL    0x0100        /* Enable mailbox interrupts */
  69. #define CONFIG_INIT    0x0200        /* Drive VME SYSRESET (will reset CPU)*/
  70. #define CONFIG_ENPAR    0x0400        /* Enable parity */
  71. #define CONFIG_SLAVE    0x0800        /* Allow Slave accesses to board */
  72. #define CONFIG_ARB    0x1000        /* Enable VME arbiter function */
  73. #define CONFIG_BADPAR    0x2000        /* Write bad parity */
  74. #define CONFIG_DOG    0x4000        /* Enable watchdog timeout */
  75. #define CONFIG_AUX2    0x8000        /* Unused */
  76.  
  77. /*
  78.  * The led bits use the top bit to indicate if the FPC is installed.
  79.  */
  80. #define    LED_REG        CPU_CONFIG
  81. #define    LED_MASK    CONFIG_LEDS    /* led bits */
  82. #define    LED_CP        0x20
  83.  
  84. #define NVSTATE_ADDR    192        /* Byte that indicates if nv valid */
  85.  
  86. /*
  87.  * System ID prom/Coprocessor present bits
  88.  */
  89. #define    SYSID_CPMSK    0x02        /* Mask for bit for CP1 indication*/
  90.  
  91. /*
  92.  * Local I/O interrupt status bits
  93.  */
  94. #define LIO_D0        0x01        /* Duart 0 interrupt */
  95. #define LIO_D1        0x02        /* Duart 1 interrupt */
  96. #define    LIO_D2        0x04        /* Duart 2 interrupt */
  97. #define LIO_SCSI    0x10        /* SCSI interrupt */
  98. #define LIO_MAIL    0x40        /* VME mailbox interrupt */
  99. #define LIO_AC        0x80        /* VME AC fail interrupt */
  100.  
  101. /*
  102.  * Switch  bits
  103.  */
  104. #define    S1MASK        0x00ff        /* software configuration register */
  105. #define    S2MASK        0xff00        /* high byte of VME A32 board mem adr */
  106. #define    S2CPUNO        0x0c00        /* CPU number */
  107.  
  108. /*
  109.  * Parity error register bits
  110.  */
  111. #define PAR_LAN        0x01        /* LAN generated error */
  112. #define PAR_DMA        0x02        /* DMA generated error */
  113. #define PAR_CPU        0x04        /* CPU generated error */
  114. #define PAR_VME        0x08        /* VME generated error */
  115. #define PAR_B3        0x10        /* Parity error in byte 3 */
  116. #define PAR_B2        0x20        /* Parity error in byte 2 */
  117. #define PAR_B1        0x40        /* Parity error in byte 1 */
  118. #define PAR_B0        0x80        /* Parity error in byte 0 */
  119.  
  120. /*
  121.  * SCSI Control
  122.  */
  123.  
  124. #define SCSI_TO_MEM    0x80        /* transfer in */
  125.  
  126. /*
  127.  * VME I/O space defines
  128.  */
  129. #define    VME_A16NPBASE    0x1d100000    /* a16 non-privileged address sp */
  130. #define VME_A16NPSIZE    0x00010000    /* size */
  131.  
  132. #define    VME_A16SBASE    0x1d000000    /* a16 supervisor address sp */
  133. #define VME_A16SSIZE    0x00010000    /* size */
  134.  
  135. #define    VME_A24NPBASE    0x1e000000    /* a24 non-privileged address sp */
  136. #define VME_A24NPSIZE    0x01000000    /* size */
  137.  
  138. #define    VME_A24SBASE    0x1c000000    /* a24 supervisor address sp */
  139. #define VME_A24SSIZE    0x01000000    /* size */
  140.  
  141. #define    VME_A32NPBASE    0x10000000    /* a32 non-privileged address sp */
  142. #define VME_A32NPSIZE    0x0c000000    /* size */
  143.  
  144. #define    VME_2A32NPBASE    0x20000000    /* 2nd a32 non-privileged address sp */
  145.  
  146. #define    VME_A32SBASE    0x0        /* a32 supervisor address sp */
  147. #define VME_A32SSIZE    0x0        /* size */
  148.  
  149.  
  150. #define vme_adapter(addr) 0        /* only 1 VME adapter */
  151.  
  152. /*
  153.  * non-volatile ram addresses
  154.  * NOTE: everything must fit within 2kb for the Smart Watch.  Each
  155.  *     byte at a longword boundary.
  156.  * ALSO NOTE: we need to reserve the last 2 bytes of NV RAM for a checksum
  157.  *           and for use in setting the real-time clock.
  158.  */
  159. #define    NVLEN_MAX    (2046 * 4)  /* last 2 bytes reserved */
  160. #define    NVOFF_BASE    0
  161.  
  162. /*
  163.  * state maintains the current validity of the tod clock and
  164.  * non-volatile ram
  165.  * see NVSTATE_* definitions below
  166.  */
  167. #define    NVOFF_STATE    (NVOFF_BASE)
  168. #define    NVLEN_STATE    1
  169.  
  170. /*
  171.  * netaddr is used by network software to determine the internet
  172.  * address, it should be a string containing the appropriate
  173.  * network address in "." format
  174.  */
  175. #define    NVOFF_NETADDR    (NVOFF_STATE+(NVLEN_STATE*4))
  176. #define    NVLEN_NETADDR    16
  177.  
  178. /*
  179.  * lbaud/rbaud are the initial baud rates for the duart
  180.  * (e.g. "9600")
  181.  */
  182. #define    NVOFF_LBAUD    (NVOFF_NETADDR+(NVLEN_NETADDR*4))
  183. #define    NVLEN_LBAUD    5
  184.  
  185. #define    NVOFF_RBAUD    (NVOFF_LBAUD+(NVLEN_LBAUD*4))
  186. #define    NVLEN_RBAUD    5
  187.  
  188. /*
  189.  * bootfile is the initial program loaded on an autoboot
  190.  * (e.g. "bfs(0)mipsboot_le")
  191.  */
  192. #define    NVOFF_BOOTFILE    (NVOFF_RBAUD+(NVLEN_RBAUD*4))
  193. #define    NVLEN_BOOTFILE    50
  194.  
  195. /*
  196.  * bootmode controls autoboots/warm starts/command mode on reset
  197.  * "a" => autoboot on reset
  198.  * "w" => warm start if restart block correct, else autoboot
  199.  * anything else cause entry to command mode
  200.  */
  201. #define    NVOFF_BOOTMODE    (NVOFF_BOOTFILE+(NVLEN_BOOTFILE*4))
  202. #define    NVLEN_BOOTMODE    1
  203.  
  204. /*
  205.  * console controls what consoles are enabled at power-up
  206.  * 'a' indicates "all" consoles
  207.  * 'r' indicates both local and remote uarts
  208.  * anything else indicates only local uart
  209.  */
  210. #define    NVOFF_CONSOLE    (NVOFF_BOOTMODE+(NVLEN_BOOTMODE*4))
  211. #define    NVLEN_CONSOLE    1
  212.  
  213. /*
  214.  * failcode is used by the power-on diagnostics to save a failure
  215.  * code for use by service techs
  216.  */
  217. #define    NVOFF_FAILCODE    (NVOFF_CONSOLE+(NVLEN_CONSOLE*4))
  218. #define    NVLEN_FAILCODE    1
  219.  
  220. /*
  221.  * root identifies the disk partition that the root device will reside on.
  222.  */
  223. #define NVOFF_ROOT    (NVOFF_FAILCODE+(NVLEN_FAILCODE*4))
  224. #define NVLEN_ROOT    20
  225.  
  226. /*
  227.  * keybd indicates the type of keyboard that is attached
  228.  */
  229. #define NVOFF_KEYBD    (NVOFF_ROOT+(NVLEN_ROOT*4))
  230. #define NVLEN_KEYBD    10
  231.  
  232. #define NVOFF_MONITOR    (NVOFF_KEYBD+(NVLEN_KEYBD*4))
  233. #define NVLEN_MONITOR    4
  234.  
  235. #define NVOFF_SYNC_ON_GREEN (NVOFF_MONITOR+(NVLEN_MONITOR*4))
  236. #define NVLEN_SYNC_ON_GREEN 1
  237.  
  238. #define NVOFF_DISKLESS    (NVOFF_SYNC_ON_GREEN+(NVLEN_SYNC_ON_GREEN*4))
  239. #define NVLEN_DISKLESS    1
  240.  
  241. #define NVLEN_TOTAL    (NVOFF_DISKLESS+(NVLEN_DISKLESS*4))
  242. #if NVLEN_TOTAL > NVLEN_MAX
  243. # include "error -- non-volatile ram overflow"
  244. #endif
  245.  
  246. /*
  247.  *  checksum is used by the power-on diagnostics to check the validity
  248.  *  of the Non-Volatile RAM contents.  let's put it at end of nvram.
  249.  */
  250. #define NVOFF_CHECKSUM        NVLEN_MAX
  251. #define    NVLEN_CHECKSUM        1
  252. #define NVCHECKSUM_ADDR        (NVRAM_ADDR + NVOFF_CHECKSUM)
  253. #define NVCHECKSUM_K1ADDR    PHYS_TO_K1(NVCHECKSUM_ADDR)
  254.  
  255. #ifdef LANGUAGE_C
  256. typedef struct scuzzy {
  257.     u_char        *d_addr;    /* address register */
  258.     u_char        *d_data;    /* data register */
  259.     unsigned char d_initflags;    /* initial flags for d_flags */
  260.     unsigned char d_clock;    /* value for clock register on WD chip */
  261. } scuzzy_t;
  262. #endif /* LANGUAGE_C */
  263.  
  264. #define    dcache_wb(X,Y)
  265. #define    dcache_wbinval(X,Y)    dcache_inval(X,Y)
  266.  
  267. #endif /* __SYS_IP4_H__ */
  268.